#ifndef WEN_IMPORTER_ASSIMP_H
#define WEN_IMPORTER_ASSIMP_H

#include "system/wen_system.h"

//Assimp
#include <assimp/Importer.hpp> //For c++
//#include <assimp/cimport.h> //For c
#include <assimp/scene.h> //Output data structure
#include <assimp/postprocess.h> //Post processing flags
//#include <assimp/types.h>

//----------------------------------------------------------------
namespace wen
{
//----------------------------------------------------------------

class Node;
class Geometry;

class WEN_API ImporterWithAssimp
{
public:

	ImporterWithAssimp();
	~ImporterWithAssimp();

	bool Load(const std::string& rkFilename);

	Node* GetRootNode();

private:
	std::string m_strThePath;
	
	Node* m_pkRootNode;

	const aiScene* m_pAssimpLoadedScene;

	void ImportNode(aiNode* assimpNode, Node* parentNode);
	void ImportTransformationMatrix(aiNode* assimpNode, Node* node);	

	Geometry* ImportGeometry(aiNode* assimpNode, aiMesh* assimpMesh);

	void ImportVertex(aiMesh* assimpMesh, Geometry* theGeometry);
	void ImportIndex(aiMesh* assimpMesh, Geometry* theGeometry);
	void ImportNormal(aiMesh* assimpMesh, Geometry* theGeometry);
	void ImportTextureCoords(aiMesh* assimpMesh, Geometry* theGeometry);
	void ImportMaterial(aiMesh* assimpMesh, Geometry* theGeometry);

	std::string m_strGlobalPath;	
};
//----------------------------------------------------------------
} // end namespace
//----------------------------------------------------------------
#endif // WEN_IMPORTER_ASSIMP_H
//----------------------------------------------------------------